#include <stdio.h>
#include <stdlib.h>
#include <omp.h>

#include "io.h"
#include "JacobisMethod.h"

#ifndef PARALLEL_JACOBIS_METHOD_H

   #define PARALLEL_JACOBIS_METHOD_H

   #define OK 1

    struct unknownsStrip{
        double *vector;
        unsigned int length;
        unsigned int lowerChunk;
        unsigned int upperChunk;
        char isItok;
    };

    struct unknownsStrip *ParallelJacobisMethod(
           struct extendedMatrix *M,
           struct unknownsStrip *X);

    int findMyChunk(
                   struct extendedMatrix *M, /* IN */
                   struct unknownsStrip *X,  /* OUT */
                   int rank,                 /* INT */
                   int nProcess              /* INT */
                   );

    double jmFindXi(struct extendedMatrix *M,
                    unsigned long line,
                    double *X);

    struct unknownsStrip *initStrip();
    void freeStrip(struct unknownsStrip *X);

#endif
